"""
@name : 5-1.多进程-数据共享-Array
@author : wenyao
@projectname: sanchuanglianxi
"""

from multiprocessing import Process
from multiprocessing import Array

def func(i, temp):
    temp[0] += 100
    #print(temp)
    # for item in temp:
    print(i, "------->",temp[0])

if __name__ == "__main__":
    temp = Array("i",[11,22,33])
    #temp = [11,22,33]
    for i in range(3):
        p = Process(target = func, args = (i,temp))
        p.start()

